<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../../include/admincontent.jsp" %>
<div id="Content">
<%--    <div class="btnbar">
        &lt;%&ndash;<button type="button" class="save" id="savebtn">保存实习结果</button>&ndash;%&gt;
        <button type="button" class="save" id="sx_result">保存实习结果</button>
        <button type="button" class="list" id="sx_msg">发短信</button>
        <button type="button" class="card" id="publishresult" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</button>
        <button type="button" class="list" id="do_zznext">进入下一步</button>
        <button type="button" class="save" id="resume_output">导出</button>
        <button type="button" class="save" id="resume_input">导入</button>
    </div>--%>
    <div class="toolbars" style="height:30px;white-space:nowrap;width:auto;margin-left: 10px;" totalwidth="314">
        <a id="sx_result">
            <em class="ico16 save_as_16"></em>
            <span class="menu_span" title="保存实习结果">保存实习结果</span>
        </a>
        <a id="sx_msg" style="margin-left: 5px">
            <em  class="ico16 common_language_16"></em>
            <span  class="menu_span" title="发短信">发短信</span>
        </a>
        <a id="publishresult" style="margin-left: 5px">
            <em  class="ico16 plan_16"></em>
            <span  class="menu_span" title="公布/屏蔽结果" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</span>
        </a>
        <a id="do_zznext" style="margin-left: 5px">
            <em  class="ico16 more_blue"></em>
            <span  class="menu_span" title="进入下一步">进入下一步</span>
        </a>
        <a id="resume_output" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_down"></em>
            <span  class="menu_span" title="导出">导出</span>
        </a>
        <a id="resume_input" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_up"></em>
            <span  class="menu_span" title="导入">导入</span>
        </a>
    </div>
    <!--实习情况-->
    <div id="resultpanel" class="condition_cont">
        <form id="thisform1" method="post" action="/Do/SZPractice/RAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="55">实习结果:</td>
                    <td width="100">
                        <div>
                            <select name="sxstate">
                                <%--<option value="已通过">已通过</option>
                                <option value="未通过">未通过</option>--%>
                                    <option value='未安排'>未安排</option>
                                    <option value='已安排'>已安排</option>
                                    <option value='未通过'>未通过</option>
                                    <option value='已通过'>已通过</option>
                            </select>
                        </div>
                    </td>
                    <td width="30">备注:</td>
                    <td width="300">
                        <div><input type="text" name="sxremark"/></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="4">
                        <button type="submit" class="op">保存体检结果</button>
                    </td>
                </tr>
                </thead>
            </table>
            <div id="rusers">
                <input type="hidden" name="uid" value="" id="rusersIds"/>
            </div>
        </form>
    </div>

    <!-- 体检通知 -->
    <div id="msgpanel" class="condition_cont">
        <form id="thisform2" method="post" action="/Do/SZPractice/MsgAction?fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">短信模版：</td>
                    <td width="400">
                        <div><select id="dxmb" datatype="*" nullmsg="短信模版不能为空！">${dxmb}</select></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>短信内容：</td>
                    <td>
                        <div><textarea name="dxnr" datatype="*" nullmsg="短信内容不能为空！"></textarea></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button type="submit" class="save">提 交</button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>
            <div id="msgusers">
                <input type="hidden" name="uid" value="" id="msgusersIds"/>
            </div>
        </form>
    </div>

    <!-- 筛选条件 -->
    <div id="searchbox">
        <form id="sform">
            <input type="hidden" name="proid" value="${pid}"/>
            <input type="hidden" name="path" value="${fid}"/>
            <input type="hidden" name="deptcode" value="${deptcode}"/>
            <input type="hidden" name="rcount" id="checkrount" value=""/>
            <input type="hidden" name="checkIds" id="checkIds" value=""/>
            <%--<table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">学校名称：</td>
                    <td width="200">
                        <div><select name="adduid">${school}</select></div>
                    </td>
                    <td width="60">人员姓名：</td>
                    <td width="120">
                        <div><input type="text" name="name"/></div>
                    </td>
                    <td width="60">身份证号：</td>
                    <td width="120">
                        <div><input type="text" name="code"/></div>
                    </td>
                    <td width="60">实习情况：</td>
                    <td width="80">
                        <div>
                            <select name="sxstate">
                                <option value="">全部</option>
                                <option value="未安排">未安排</option>
                                <option value="已安排">已安排</option>
                                <option value="已通过">已通过</option>
                                <option value="未通过">未通过</option>
                            </select>
                        </div>
                    </td>
                    <td width="30">
                        <button id="searchbtn" type="button" class="search"></button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>--%>

            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td>毕业院校:</td>
                    <td>
                        <div>
                            <select name="adduid">
                                ${school}
                                <option value="">全部</option>
                            </select>
                        </div>
                    </td>
                    <td>身份证号:</td>
                    <td>
                        <div><input type="text" name="code"/></div>
                    </td>

                    <td>姓名:</td>
                    <td colspan="3">
                        <div>
                            <input type="text" name="name"/>
                        </div>
                    </td>
                    <td>所学专业:</td>
                    <td colspan="3">
                        <div>
                            <input type="text" name="major"/>
                        </div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>毕业年份:</td>
                    <td>
                        <div><input type="text" name="graduationyear"/></div>
                    </td>
                    <td>联系电话:</td>
                    <td>
                        <div>
                            <input type="text" name="tel"/>
                        </div>
                    </td>
                    <td>岗位组:</td>
                    <td colspan="3">
                        <div><select name="job">
                            <option value="">不限</option>
                            <c:forEach var="projectinfojobs" items="${jobs}" varStatus="item" >
                                <c:choose>
                                    <c:when test="${projectinfojobs!=null}">
                                        <option value="${projectinfojobs.jobname}">${projectinfojobs.jobname}</option>
                                    </c:when>

                                </c:choose>
                            </c:forEach>
                        </select>
                        </div>
                    </td>

                    <td>实习情况：</td>
                    <td colspan="3">
                        <div>
                            <select name="sxstate">
                                <option value="">全部</option>
                                <option value="未安排">未安排</option>
                                <option value="已安排">已安排</option>
                                <option value="已通过">已通过</option>
                                <option value="未通过">未通过</option>
                            </select>
                        </div>
                    </td>

                    <td></td>
                </tr>
                <tr class="moretj">

                    <td width="80">公布情况:</td>
                    <td width="150">
                        <div><select name="op7">
                            <option value="">全部</option>
                            <option value="已公布">已公布</option>
                            <option value="未公布">未公布</option>
                        </select></div>
                    </td>
                    <td width="80">性别:</td>
                    <td width="150">
                        <div>
                            <select name="gender">
                                <option value="">不限</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </td>
                    <td width="70" style="text-align:right;">年龄:</td>
                    <td width="60">
                        <div><input type="text" name="agefrom"/></div>
                    </td>
                    <td width="16" style="text-align:center;">至</td>
                    <td width="60">
                        <div><input type="text" name="ageto"/></div>
                    </td>
                    <td width="70" style="text-align:right;">身高:</td>
                    <td width="50">
                        <div><input type="text" name="heightfrom"/></div>
                    </td>
                    <td width="36" style="text-align:center;">至</td>
                    <td width="50">
                        <div><input type="text" name="heightto"/></div>
                    </td>
                    <td></td>
                </tr>
                <%--<tr class="moretj">
                    <td>性别:</td>
                    <td>
                        <div>
                            <select name="gender">
                                <option value="">不限</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </td>

                    <td>户口所在地:</td>
                    <td>
                        <div><input type="text" name="hukouaddress"/></div>
                    </td>
                    <td>现居住地:</td>
                    <td colspan="3">
                        <div><input type="text" name="nowaddress"/></div>
                    </td>
                    <td>筛选状态:</td>
                    <td colspan="3">
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                    <td></td>
                </tr>--%>
                <tr>
                    <td colspan="12">
                        <div class="toolbars">
                            <a id="searchbtn">
                                <em class="ico16 search_16"></em>
                                <span >查询</span>
                            </a>
                            <a id="clearbtn">
                                <em class="ico16 refresh_16"></em>
                                <span>清除</span>
                            </a>
                        </div>
                      <%--  <div style="padding-top: 8px;"> <button id="searchbtn" type="button" class="search"></button>
                            <button id="clearbtn" type="reset" class="del" title="清除" style="flex: 1;margin-left: 5px;"></button>
                        </div>--%>
                    </td>
                    <td>
                        <div class="toolbars">
                            <a onclick="moreparam()">
                                <em class="ico16 search_disable_16"></em>
                                <span >高级查询</span>
                            </a>
                        </div>
                       <%-- <button id="showhidebtn" type="button" class="moretjbtn0" onclick="moreparam()"
                                title="高级查询"></button>--%>
                    </td>
                </tr>
                </thead>
            </table>
        </form>
    </div>
    <form id="Validform" method="post" action="">
        <input type="hidden" name="pid" value="${pid}"/>
        <input type="hidden" name="fid" value="${fid}"/>
        <input type="hidden" name="deptcode" value="${deptcode}"/>
        <button type="submit" id="okbtn" style="display:none;"></button>
        <div id="page_top" class="page"></div>
        <table class="treeTable" id="tablelist">
            <thead>
            <tr>
                <td width="20"><input type="checkbox" class="allcheckbox" title="选择全部/取消全选"/></td>
                <td width="25">序号</td>
                <td width="60">姓名</td>
                <td width="30">性别</td>
                <td width="120">身份证号</td>
                <td width="50">工作经验</td>
                <td width="120">招聘职位</td>
                <td width="120">专业</td>
                <td width="70">学历</td>
                <td width="80">联系方式</td>
                <td width="70">实习情况</td>
                <td width="70">备注</td>
                <td width="70">个人情况</td>
                <td width="50">公布结果</td>
                <td width="45"></td>
            </tr>
            </thead>
            <tbody id="result"></tbody>
        </table>
    </form>
    <div id="page_bottom" class="page"></div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        getList();
/*        $('#searchbtn').click(function () {
            $('#rusersIds').val('');
            $('#msgusersIds').val('');
            getList();
        });*/
        $('#searchbtn').on('click',function () {
            $('#rusersIds').val('');
            $('#msgusersIds').val('');
            getList();
        });

        $('#clearbtn').on('click',function () {
            document.getElementById("sform").reset();
        });

        $('#savebtn').click(function () {
            $('#okbtn').click();
        });

        $('#sx_result').click(function () {
            var checkedIds=$('.allcheckbox').data('checkIds');
            var reg=new RegExp('cb_','g');
            var  ids= checkedIds.toString().split(',');
            for (var i = 0; i < ids.length; i++) {
                ids[i]=ids[i].replace(reg,'');
                //$('#rusersIds').append('<input type="hidden" name="uid" value="' + id + '"/>');
            }
            $('#rusersIds').val(checkedIds);
            $('#resultpanel').slideToggle(300);
            $(this).toggleClass('cur').blur().siblings().removeClass('cur');

        });

        //体检通知
        $('#tj_msg').click(function () {
            var checkedIds=$('.allcheckbox').data('checkIds');
            var reg=new RegExp('cb_','g');
            var  ids= checkedIds.toString().split(',');
            for (var i = 0; i < ids.length; i++) {
                ids[i]=ids[i].replace(reg,'');
                //$('#rusersIds').append('<input type="hidden" name="uid" value="' + id + '"/>');
            }
            $('#msgusersIds').val(checkedIds);
            $('#msgpanel').slideToggle(300);
            $(this).toggleClass('cur').blur().siblings().removeClass('cur');
            if (!$('#planpanel').is(":hidden")) {
                $('#planpanel').slideToggle(300);
            }
            if (!$('#resultpanel').is(":hidden")) {
                $('#resultpanel').slideToggle(300);
            }


        });

        $('#do_zznext').click(function () {
           // layer.confirm('只能将本部门负责招聘实施的信息提交到下一步<br>确定要执行吗？', {
            parent.layer.confirm('只有实习通过的人员才能进入下一步，确定要执行吗？', {
                btn: ['是', '否']
            }, function () {
                toNextFlow('/Do/SZPhysical/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}','${fid}');
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });
        });

    });

    function getList() {
        $('.page').myPagination({
            cssStyle: "pagination",
            saveChecked:true,
            showTitle:true,
            rowNumber:true,
            contextMenu:true,
            contextMenuParam:{
                menu: [{
                    text: "情况说明",
                    callback: function(ele) {
                        console.log($(this))
                        var tcid=$(ele).find('input[type=checkbox]:eq(0)').attr('id');
                        var rmarkid=$(ele).find('input[type=hidden]:eq(0)').val();
                        var cardno=ele[0].cells[4].innerText;
                        var rname=ele[0].cells[2].innerText;
                        parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 个人情况说明，并确认', formType: 2}, function(text, index){
                            parent.layer.close(index);
                            var cid=tcid.replace('cb_','');
                            $.post("/SaveUserRemark"
                                ,{id:rmarkid,pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",rid:cid,content:text,rname:rname,cardno:cardno}
                                ,function (result) {
                                    if (result.state) {
                                        $.Showmsg(result.message);
                                        getList();
                                    }
                                    else {
                                        $.Showmsg(result.message);
                                    }
                                }
                                ,"json");
                        });
                    }
                },
                    {
                        text: "查看个人简历",
                        callback: function(ele) {
                            var url=$(ele).find('a').attr('href');
                            if(!!url){
                                window.open(url);
                            }
                        }
                    },
                    {
                        text: "刷新列表",
                        callback: function() {
                            getList()
                        }
                    }
                ]
            },
            ajax: {
                on: true,
                url: '${path}/Do/SZPractice/getusers?flowid=${fid}',
                param: $('#sform').serialize(),
                dataType: 'html',
                callback: function (data) {
                    $('#result').html(data);
                    $('#result select').each(function () {
                        $(this).val($(this).next().val());
                    });
                    parent.changeFrameHeight();
                    $('#result a').click(function () {
                        event.stopPropagation();
                    });
                }
            }
        });
    }
    $(function () {

        $('#resume_output').click(function () {
            var ids= $('#checkIds').val('').val();
            var selectData = layui.table.checkStatus('listTables').data;
            if(selectData!=undefined&&selectData.length>0){
                for(var i=0;i<selectData.length;i++){
                    ids += selectData[i].id_cb.replace('cb_', '') + ',';
                }
                ids=ids.substr(0,ids.length-1);
                $('#checkIds').val(ids);
            }
            openpLayer('请选择要导出的字段', '/ExcelDown/DownDoResume?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '70%');
        });
        $('#resume_input').click(function () {
            openpLayer('Excel数据导入', '/ExcelImport/ImportExcelPage?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '500px');
        });
    });
</script>
</body>
</html>